<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"> 

<h:head>
<h1>LISTAR PESSOAS</h1>
</h:head> 
<body> 
<h:form id="listaPessoas">Pessoas<br />
		<h:dataTable border="1" value="#{listarPessoas.listaAll}" var="pessoa">
			<h:column id="column1">				
					<h:outputText value="#{pessoa.nome}">
					</h:outputText>
					<f:param name="nome" value="#{pessoa.nome}"></f:param>				
				<f:facet name="header">
					<h:outputText value="Nome"></h:outputText>
				</f:facet>
									
			</h:column>
			<h:column id="column2">				
					<h:outputText value="#{pessoa.RG}">
					</h:outputText>
					<f:param name="RG" value="#{pessoa.RG}"></f:param>				
				<f:facet name="header">
					<h:outputText value="RG"></h:outputText>
				</f:facet>
			
			</h:column>			
			<h:column id="column3">				
					<h:outputText value="#{pessoa.CPF}">
					</h:outputText>
					<f:param name="cpf" value="#{pessoa.CPF}"></f:param>				
				<f:facet name="header">
					<h:outputText value="CPF"></h:outputText>
				</f:facet>
			</h:column>
			<h:column id="column4">				
					<h:outputText value="#{pessoa.endereco}">
					</h:outputText>
					<f:param name="endereco" value="#{pessoa.endereco}"></f:param>				
				<f:facet name="header">
					<h:outputText value="Endereço"></h:outputText>
				</f:facet>
			</h:column>
			<h:column id="column5">				
					<h:outputText value="#{pessoa.complemento}">
					</h:outputText>
					<f:param name="complemento" value="#{pessoa.complemento}"></f:param>				
				<f:facet name="header">
					<h:outputText value="Complemento"></h:outputText>
				</f:facet>
			</h:column>
			<h:column id="column6">				
					<h:outputText value="#{pessoa.CEP}">
					</h:outputText>
					<f:param name="cep" value="#{pessoa.CEP}"></f:param>				
				<f:facet name="header">
					<h:outputText value="CEP"></h:outputText>
				</f:facet>
			</h:column>
			<h:column id="column7">				
					<h:outputText value="#{pessoa.bairro}">
					</h:outputText>
					<f:param name="bairro" value="#{pessoa.bairro}"></f:param>				
				<f:facet name="header">
					<h:outputText value="Bairro"></h:outputText>
				</f:facet>
			</h:column>
			<h:column>
			<h:commandButton action="#{excluirPessoa.excluirActionListener(pessoa.CPF)}" id="Excluir" style="width:80px;" value="Excluir"></h:commandButton>
			<h:commandButton actionListener="#{atualizarPessoa.alterarActionListener()}" id="Alterar" style="width:80px;" value="Alterar">
			</h:commandButton>			
			</h:column>			
			<h:column>			
				<h:link outcome="/Pessoa/cadastroPessoa.xhtml">
					<h:outputLabel value="Atualizar"></h:outputLabel>
				<f:param name="cpf" value="#{pessoa.CPF}"></f:param></h:link>			
			</h:column>							
		</h:dataTable>
		<div>		
			<h:commandButton id="voltar" value="Voltar" action="/index" immediate="true" style="width: 80px;"></h:commandButton>	
		</div>	
		<h:messages />	
		<br>
		</br>
		<div>
		<h:selectOneMenu id="pessoaNome" value="#{pessoa.nome}">
		<f:selectItems itemLabel="Nome Pessoa"/>
		</h:selectOneMenu>
		</div>
	</h:form>

</body> 
</html>
